package com.cq.xjms.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * 用户基类
 * 
 * @author Vincent
 */
//@Entity
//@Table(name = "EXHIBITION_USER")
//@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
//@NamedQueries( {
//		@NamedQuery(name = "User.userExists", query = "SELECT count(u.id) FROM User u WHERE u.email = :email"),
//		@NamedQuery(name = "User.findUserByEmail", query = "SELECT u FROM User u WHERE u.email = :email") })
//public class User extends BaseEntity {


@Entity
@Table(name = "USER")
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
public class User extends BaseEntity{

	private static final long serialVersionUID = 8825616410502042893L;
	@Column(name = "NAME", length = 50, nullable = false, unique = true)
	private String name;
	@Column(name = "PASSWORD", length = 50, nullable = false)
	private String password;
	@Column(name = "EMAIL", length = 50, unique = true)
	private String email;
	@Column(name = "TEL", length = 15)
	private String tel;
	@Column(name = "PHONE", length = 11)
	private String phone;
	@Column(name = "EMPNO", length = 20, nullable = false)
	private String empNo;
	@ManyToOne(fetch = FetchType.LAZY)
	private Role role;
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	public String getEmail() {
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	public String getTel() {
		return tel;
	}
	public void setTel(String tel) {
		this.tel = tel;
	}
	public String getPhone() {
		return phone;
	}
	public void setPhone(String phone) {
		this.phone = phone;
	}
	public String getEmpNo() {
		return empNo;
	}
	public void setEmpNo(String empNo) {
		this.empNo = empNo;
	}
	public Role getRole() {
		return role;
	}
	public void setRole(Role role) {
		this.role = role;
	}
	
	

	
}
